
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="/template/main_list.xhtml">

	<ui:param name="resultList" value="#{pagamentoListMB.resultList}"/>
 	<ui:param name="tituloLista" value="#{messages['pagamento.list.table.title']}"/>

	<ui:define name="botoes">
					<p:commandButton title="#{messages['button.new']}" icon="ui-icon-document" action="#{pagamentoListMB.getNextView}"
						actionListener="#{pagamentoListMB.clear}" ajax="false" />

					<p:commandButton title="#{messages['button.delete']}" icon="ui-icon-trash" onclick="confirmation.show()"
						type="button" immediate="true" ajax="false" />

					<p:confirmDialog message="#{messages['label.confirm.delete']}" showEffect="bounce" hideEffect="explode"
						header="#{messages['label.dialog.alert']}!" severity="alert" widgetVar="confirmation">

						<h:commandButton value="#{messages['button.dialog.yes']}" action="#{pagamentoListMB.deleteSelection}"
							actionListener="#{pagamentoListMB.clear}" />
						<h:commandButton value="#{messages['button.dialog.no']}" onclick="confirmation.hide()" type="button" />
					</p:confirmDialog>
	</ui:define>
	<ui:define name="filtro">
			<p:fieldset legend="#{messages['filtrar.pagamento']}" toggleable="true" toggleSpeed="500">
				<h:panelGrid columns="2">
					<h:outputLabel value="#{messages['pagamento.label.unidadeOrcamentaria']}: " for="unidadeOrcamentaria" styleClass="text-input" />
					<h:panelGrid columns="5">
						<h:selectOneMenu value="#{pagamentoListMB.unidadeOrcamentaria}" id="unidadeOrcamentaria" style="width: 350px;"
							title="#{messages['pagamento.label.unidadeOrcamentaria']}" 
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{pagamentoListMB.unidadeOrcamentarias}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="unidadeOrcamentaria" />
	
						<h:outputLabel value="#{messages['pagamento.label.obra']}: " for="obra" styleClass="text-input" />
						<h:selectOneMenu value="#{pagamentoListMB.obra}" id="obra" style="width: 550px;"
							title="#{messages['pagamento.label.obra']}" 
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{pagamentoListMB.obras}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="obra" />
					</h:panelGrid>

					<h:outputLabel value="#{messages['pagamento.label.numDocPagamento']}: " for="numDocPagamento" styleClass="text-input" />
					<h:panelGrid columns="2">
						<h:inputText id="numDocPagamento" value="#{pagamentoListMB.numDocPagamento}"
							title="#{messages['aditivo.alt.numDocPagamento']}" />
						<p:message for="numDocPagamento" />
					</h:panelGrid>

					<h:outputLabel value="#{messages['pagamento.label.numDocAutorizacao']}: " for="numDocAutorizacao" styleClass="text-input" />
					<h:panelGrid columns="2">
						<h:inputText id="numDocAutorizacao" value="#{pagamentoListMB.numDocAutorizacao}"
							title="#{messages['aditivo.alt.numDocAutorizacao']}" />
						<p:message for="numDocAutorizacao" />
					</h:panelGrid>

					<h:outputLabel value="#{messages['pagamento.label.numDocFiscal']}: " for="numDocFiscal" styleClass="text-input" />
					<h:panelGrid columns="2">
						<h:inputText id="numDocFiscal" value="#{pagamentoListMB.numDocFiscal}"
							title="#{messages['aditivo.alt.numDocFiscal']}" />
						<p:message for="numDocFiscal" />
					</h:panelGrid>
				</h:panelGrid>

			    <h:commandButton value="#{messages['button.pesquisar']}"  action="#" ajax="true" >
		    		<f:ajax execute="list" render="list" />
		    	</h:commandButton>

			</p:fieldset>	
	</ui:define>
	
	<ui:define name="colunaMarcacao">
			<p:column style="width:1%;">
				<h:selectBooleanCheckbox value="#{pagamentoListMB.selection[bean.id]}"></h:selectBooleanCheckbox>
			</p:column>
	</ui:define>
	
	
	<ui:define name="colunas">
				
				<p:column style="width:5%;" sortBy="#{bean.id}">
					<f:facet name="header">#{messages['pagamento.label.id']}</f:facet>
					<h:outputText value="#{bean.id}" />
				</p:column>
						
				<p:column sortBy="#{bean.documentoPagamento.descricao}">
					<f:facet name="header">#{messages['pagamento.label.documentoPagamento']}</f:facet>
					<h:commandLink action="#{pagamentoListMB.getNextView}" actionListener="#{pagamentoListMB.clear}">
						<h:outputText value="#{bean.documentoPagamento.descricao}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>

				<p:column sortBy="#{bean.numDocAutorizacao}">
					<f:facet name="header">#{messages['pagamento.label.numDocAutorizacao']}</f:facet>
					<h:commandLink action="#{pagamentoListMB.getNextView}" actionListener="#{pagamentoListMB.clear}">
						<h:outputText value="#{bean.numDocAutorizacao}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
						
				<p:column sortBy="#{bean.numDocPagamento}">
					<f:facet name="header">#{messages['pagamento.label.numDocPagamento']}</f:facet>
					<h:commandLink action="#{pagamentoListMB.getNextView}" actionListener="#{pagamentoListMB.clear}">
						<h:outputText value="#{bean.numDocPagamento}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
						
				<p:column sortBy="#{bean.numDocFiscal}">
					<f:facet name="header">#{messages['pagamento.label.numDocFiscal']}</f:facet>
					<h:commandLink action="#{pagamentoListMB.getNextView}" actionListener="#{pagamentoListMB.clear}">
						<h:outputText value="#{bean.numDocFiscal}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
						
				<p:column sortBy="#{bean.dataEmissao}">
					<f:facet name="header">#{messages['pagamento.label.dataEmissao']}</f:facet>
					<h:commandLink action="#{pagamentoListMB.getNextView}" actionListener="#{pagamentoListMB.clear}">
						<h:outputText value="#{bean.dataEmissao}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
						
				<p:column sortBy="#{bean.dataPagamento}">
					<f:facet name="header">#{messages['pagamento.label.dataPagamento']}</f:facet>
					<h:commandLink action="#{pagamentoListMB.getNextView}" actionListener="#{pagamentoListMB.clear}">
						<h:outputText value="#{bean.dataPagamento}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
						
				<p:column sortBy="#{bean.valorPagamento}">
					<f:facet name="header">#{messages['pagamento.label.valorPagamento']}</f:facet>
					<h:commandLink action="#{pagamentoListMB.getNextView}" actionListener="#{pagamentoListMB.clear}">
						<h:outputText value="#{bean.valorPagamento}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
	</ui:define>
</ui:composition>